package day06_OOP.demo07标准代码最终版;

public class Test {
    public static void main(String[] args) {
        //方法1给成员变量赋值
        //无参构造+setXxx()
        Student a1 = new Student();
        a1.setAge(18);
        a1.setName("张三");
        //输出值
        a1.show();
        System.out.println(a1.getName()+"-------"+a1.getAge());

        //方法2给成员变量赋值
        Student a2 = new Student("李四",20);
        System.out.println(a2.getName()+"-------"+a2.getAge());
        a2.show();
    }
}
